﻿<UserControl x:Name="userControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008" x:Class="Daytimer.Controls.SplitButton"
		mc:Ignorable="d" d:DesignHeight="23" d:DesignWidth="34">
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="Auto" />
		</Grid.ColumnDefinitions>
		<Border x:Name="PART_Overlay" Grid.ColumnSpan="2" BorderThickness="1" BorderBrush="Transparent" />
		<Button x:Name="PART_Button">
			<Button.Template>
				<ControlTemplate TargetType="{x:Type Button}">
					<Border x:Name="PART_Border" Background="Transparent" />
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Background" TargetName="PART_Border"
									Value="{DynamicResource RibbonMouseOver}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter Property="Background" TargetName="PART_Border"
									Value="{DynamicResource RibbonPressed}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Button.Template>
		</Button>
		<ToggleButton x:Name="PART_ToggleButton" Grid.Column="1" Width="13"
				IsChecked="{Binding IsChecked, ElementName=userControl}" ClickMode="Press">
			<ToggleButton.Template>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="PART_Border" Background="Transparent" />
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Background" TargetName="PART_Border"
									Value="{DynamicResource RibbonMouseOver}" />
						</Trigger>
						<Trigger Property="IsChecked" Value="True">
							<Setter Property="Background" TargetName="PART_Border"
									Value="{DynamicResource RibbonChecked}" />
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter Property="Background" TargetName="PART_Border"
									Value="{DynamicResource RibbonPressed}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</ToggleButton.Template>
		</ToggleButton>
		<Popup x:Name="PART_Popup" IsOpen="{Binding IsChecked, ElementName=userControl}" AllowsTransparency="True"
				HorizontalOffset="-5" VerticalOffset="-6" PopupAnimation="None" StaysOpen="False">
			<Border x:Name="OuterBorder">
				<Border.Effect>
					<DropShadowEffect Color="#FFBBBBBB" ShadowDepth="0" RenderingBias="Performance" Opacity="0.5" />
				</Border.Effect>
				<Border x:Name="InnerBorder" BorderBrush="#FFC6C6C6" BorderThickness="1"
						Background="{DynamicResource White}" Margin="5">
					<Border x:Name="ItemsPresenter" Margin="1" />
				</Border>
			</Border>
		</Popup>
	</Grid>
</UserControl>
